import request from '@/utils/request'
// 获取部门列表
export const fetchDepartmentAPI=() => {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 获取部门负责人
export const getManagerListAPI=() => {
  return request.get('/sys/user/simple')
}

// 添加子部门
export const addDepartmentAPI=(obj) => {
  return request.post('/company/department', obj)
}

// 根据id获取某个部门详情

export const getDepartmentAPI=(id) => {
  return request.get(`/company/department/${id}`)
}

// 更新 部门信息
// 给指定的id更新部门信息
export const updateDepartmentAPI=(data) => {
  return request.put(`/company/department/${data.id}`, data)
}

// 删除部门

export const delDepartmentAPI=(id) => {
  return request.delete(`/company/department/${id}`)
}
